package cn.gson.crm.controller.counselor;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.gson.crm.controller.BaseServlet;
import cn.gson.crm.model.dao.StudentPoDao;
import cn.gson.crm.model.entity.Employee;

@WebServlet("/counselor/change")
public class CounselorChangeRecord extends BaseServlet{

	/**
	 * 修改跟进记录
	 */
	private static final long serialVersionUID = 1L;
	private StudentPoDao stuPoDao = new StudentPoDao();
	@Override
	protected void post(HttpServletRequest request, HttpServletResponse response) throws Exception {
		Employee emp = (Employee) request.getSession().getAttribute("emplo");
		String stuId = request.getParameter("stuId");
		String recordId = request.getParameter("recordId");
		String content = request.getParameter("content");
		if(content.isEmpty()||content==null){
			request.getSession().setAttribute("erro", "修改内容不能为空！");
			redirect("customer/detail?id="+stuId);
			return;
		}
		stuPoDao.changeFollowStudentRecord(emp.getId(), stuId, recordId, content);
		redirect("customer/detail?id="+stuId);
	}
}
